/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thienphuc.patient.bo.impl;

import java.util.List;
import thienphuc.patient.bo.TrieuChungBO;
import thienphuc.patient.dao.TrieuChungDAO;
import thienphuc.patient.dao.impl.TrieuChungDAOImpl;
import thienphuc.patient.dto.TrieuChung;

/**
 *
 * @author QuocDat
 */
public class TrieuChungBOImpl implements TrieuChungBO {

    private TrieuChungDAO trieuChungDAO;

    public TrieuChungBOImpl() {
        this.trieuChungDAO = new TrieuChungDAOImpl(TrieuChung.class);
    }

    public List<TrieuChung> getAll() throws Exception {
        return this.trieuChungDAO.findAll();
    }

    public TrieuChung getById(int maTrieuChung) throws Exception {
        return this.trieuChungDAO.findById(maTrieuChung);
    }

    public List<TrieuChung> getByTenTrieuChung(String tenTrieuChung) throws Exception {
        return this.trieuChungDAO.findByTenTrieuChung(tenTrieuChung);
    }

    public boolean insertTrieuChung(TrieuChung trieuChung) throws Exception {
        return this.trieuChungDAO.save(trieuChung);                
    }

    public boolean updateTrieuChung(TrieuChung trieuChung) throws Exception {
        return this.trieuChungDAO.update(trieuChung);
    }
}
